<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习</title>
</head>
<body>
<button onclick="funA()">1X9</button>
<button onclick="funB()">乘法口诀表</button>
</body>
<script>
    function funB() {
        // 乘法口诀表
        for(var i = 1;i<=9;i++){
            var line = ""
            for(var j=1;j<=i;j++){
                line += i + "X" + j + "=" + (i*j) + " "
            }
            console.log(line)
        }

    }

    function funA() {
        /*
         1 x 1 = 1
         1 X 2 = 2
         1 X 3 = 3
         ....
         1 X 9 = 9
     */
        for(var i=1;i<=9;i++){
            console.log(1 + "X" + i + "=" + (i*1))
        }

    }
</script>
</html>